package slicegen;

import javax.vecmath.Point3d;
import javax.vecmath.Vector3d;

public class Plane {
	Vector3d normal;
	Point3d point;
	
	public Plane(Point3d pt, Vector3d n)
	{
		point = pt;
		normal = n;
		normal.normalize();
	}
	
	public double distanceToPlane(Point3d pt)
	{
		Point3d sub = new Point3d(pt.x - point.x, pt.y-point.y, pt.z - point.z);
		
		return normal.dot(new Vector3d(sub));
	}
}
